import 'dart:convert' show json;

class LocationMovies {

  int? lid;
  int? newActivitiesTime;
  int? totalComingMovie;
  String? bImg;
  String? date;
  String? voucherMsg;
  List<HotMovie?>? ms;

  LocationMovies.fromParams({this.lid, this.newActivitiesTime, this.totalComingMovie, this.bImg, this.date, this.voucherMsg, this.ms});

  factory LocationMovies(jsonStr) => jsonStr is String ? new LocationMovies.fromJson(json.decode(jsonStr)) : new LocationMovies.fromJson(jsonStr);

  LocationMovies.fromJson(jsonRes) {
    lid = jsonRes['lid'];
    newActivitiesTime = jsonRes['newActivitiesTime'];
    totalComingMovie = jsonRes['totalComingMovie'];
    bImg = jsonRes['bImg'];
    date = jsonRes['date'];
    voucherMsg = jsonRes['voucherMsg'];
    ms = jsonRes['ms'] == null ? null : [];

    for (var msItem in ms == null ? [] : jsonRes['ms']){
      ms?.add(msItem == null ? null : new HotMovie.fromJson(msItem));
    }
  }

  @override
  String toString() {
    return '{"lid": $lid,"newActivitiesTime": $newActivitiesTime,"totalComingMovie": $totalComingMovie,"bImg": ${bImg != null?'${json.encode(bImg)}':'null'},"date": ${date != null?'${json.encode(date)}':'null'},"voucherMsg": ${voucherMsg != null?'${json.encode(voucherMsg)}':'null'},"ms": $ms}';
  }
}

class HotMovie {

  int? NearestCinemaCount;
  int? NearestDay;
  int? NearestShowtimeCount;
  int? cC;
  int? def;
  int? id;
  int? rc;
  int? rsC;
  int? sC;
  int? ua;
  int? wantedCount;
  double? r;
  bool? is3D;
  bool? isDMAX;
  bool? isFilter;
  bool? isHot;
  bool? isIMAX;
  bool? isIMAX3D;
  bool? isNew;
  bool? isTicket;
  String? aN1;
  String? aN2;
  String? actors;
  String? commonSpecial;
  String? d;
  String? dN;
  String? img;
  String? m;
  String? movieType;
  String? rd;
  String? t;
  String? tCn;
  String? tEn;
  List<String>? p;
  List<dynamic>? versions;

  HotMovie.fromParams({this.NearestCinemaCount, this.NearestDay, this.NearestShowtimeCount, this.cC, this.def, this.id, this.rc, this.rsC, this.sC, this.ua, this.wantedCount, this.r, this.is3D, this.isDMAX, this.isFilter, this.isHot, this.isIMAX, this.isIMAX3D, this.isNew, this.isTicket, this.aN1, this.aN2, this.actors, this.commonSpecial, this.d, this.dN, this.img, this.m, this.movieType, this.rd, this.t, this.tCn, this.tEn, this.p, this.versions});

  HotMovie.fromJson(jsonRes) {
    NearestCinemaCount = jsonRes['NearestCinemaCount'];
    NearestDay = jsonRes['NearestDay'];
    NearestShowtimeCount = jsonRes['NearestShowtimeCount'];
    cC = jsonRes['cC'];
    def = jsonRes['def'];
    id = jsonRes['id'];
    rc = jsonRes['rc'];
    rsC = jsonRes['rsC'];
    sC = jsonRes['sC'];
    ua = jsonRes['ua'];
    wantedCount = jsonRes['wantedCount'];
    r = jsonRes['r'].toDouble();
    is3D = jsonRes['is3D'];
    isDMAX = jsonRes['isDMAX'];
    isFilter = jsonRes['isFilter'];
    isHot = jsonRes['isHot'];
    isIMAX = jsonRes['isIMAX'];
    isIMAX3D = jsonRes['isIMAX3D'];
    isNew = jsonRes['isNew'];
    isTicket = jsonRes['isTicket'];
    aN1 = jsonRes['aN1'];
    aN2 = jsonRes['aN2'];
    actors = jsonRes['actors'];
    commonSpecial = jsonRes['commonSpecial'];
    d = jsonRes['d'];
    dN = jsonRes['dN'];
    img = jsonRes['img'];
    m = jsonRes['m'];
    movieType = jsonRes['movieType'];
    rd = jsonRes['rd'];
    t = jsonRes['t'];
    tCn = jsonRes['tCn'];
    tEn = jsonRes['tEn'];
    p = jsonRes['p'] == null ? null : [];

    for (var pItem in p == null ? [] : jsonRes['p']){
      p?.add(pItem);
    }

    versions = jsonRes['versions'] == null ? null : [];

    for (var versionsItem in versions == null ? [] : jsonRes['versions']){
      versions?.add(versionsItem);
    }
  }

  @override
  String toString() {
    return '{"NearestCinemaCount": $NearestCinemaCount,"NearestDay": $NearestDay,"NearestShowtimeCount": $NearestShowtimeCount,"cC": $cC,"def": ${d != null?'${json.encode(d)}':'null'}ef,"id": $id,"rc": $rc,"rsC": $rsC,"sC": $sC,"ua": $ua,"wantedCount": $wantedCount,"r": $r,"is3D": $is3D,"isDMAX": $isDMAX,"isFilter": $isFilter,"isHot": $isHot,"isIMAX": $isIMAX,"isIMAX3D": $isIMAX3D,"isNew": $isNew,"isTicket": $isTicket,"aN1": ${aN1 != null?'${json.encode(aN1)}':'null'},"aN2": ${aN2 != null?'${json.encode(aN2)}':'null'},"commonSpecial": ${commonSpecial != null?'${json.encode(commonSpecial)}':'null'},"d": ${d != null?'${json.encode(d)}':'null'},"dN": ${dN != null?'${json.encode(dN)}':'null'},"img": ${img != null?'${json.encode(img)}':'null'},"m": ${m != null?'${json.encode(m)}':'null'},"movieType": ${movieType != null?'${json.encode(movieType)}':'null'},"rd": ${rd != null?'${json.encode(rd)}':'null'},"t": ${t != null?'${json.encode(t)}':'null'},"tCn": ${tCn != null?'${json.encode(tCn)}':'null'},"tEn": ${tEn != null?'${json.encode(tEn)}':'null'},"p": $p,"versions": $versions}';
  }
}

